home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdarg.h>
- #include <compiler.h>
-
- __EXTERN int _scanf __PROTO((const char **buf, int (*get)(unsigned char **s),
- int (*unget)(int c, unsigned char **s),
- const char *fmt, va_list argp));
-
- static int sgetc(s)
- unsigned char **s;
- {
- register unsigned char c;
-
- c = *(*s)++;
- return((c == '\0') ? EOF : c);
- }
-
- static int sungetc(c, s)
- int c;
- unsigned char **s;
- {
- if(c == EOF)
- c = '\0';
- return(*--(*s) = c);
- }
-
- #ifdef __STDC__
- int sscanf(const char *buf, const char *fmt, ...)
- #else
- int sscanf(buf, fmt)
- const char *buf, *fmt;
- #endif
- {
- va_list argp;
-
- va_start(argp, fmt);
- return(_scanf(&buf, sgetc, sungetc, fmt, argp));
- }
-
- int vsscanf(buf, fmt, args)
- const char *buf;
- const char *fmt;
- va_list args;
- {
- return(_scanf(&buf, sgetc, sungetc, fmt, args));
- }
-
-